package br.mikhas.task.data;

import java.util.Collection;
import java.util.Date;

import br.mikhas.task.Status;
import br.mikhas.task.Task;
import br.mikhas.task.TaskList;

public interface TaskRepository {
	/**
	 * Get recurrent tasks from the repository
	 * 
	 * @return recurrent tasks
	 */
	public Collection<Task> getRecurrent();

	/**
	 * Gets from the repository all tasks from a {@link TaskList} and filters it
	 * by final state
	 * 
	 * @param list
	 *            The task list to query the tasks
	 * @param finalState
	 *            The required final state
	 * @return
	 */
	public Collection<Task> getByList(TaskList list, boolean finalState);

	/**
	 * Gets from the repository all tasks from a {@link TaskList} and filters by
	 * its status
	 * 
	 * @param list
	 *            The task list to query the tasks
	 * @param status
	 *            The required status
	 * @return
	 */
	public Collection<Task> getByList(TaskList list, Status status);

	/**
	 * Checks if the given parent task has an occurrence scheduled for the given
	 * date
	 * 
	 * @param date
	 *            The date to check
	 * @param task
	 *            The parent task
	 * @return
	 */
	public boolean hasOcurrenceForDate(Date date, Task task);

	public void save(Task occurrence);
}
